//
// Created by Administrator on 2025/2/14.
//
#include <termios.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <cstring>
#include <jni.h>
#include <exception>
#include "android/log.h"

static const char *TAG = "SerialPort";
#define LOG_I(fmt, args...) __android_log_print(ANDROID_LOG_INFO,  TAG, fmt, ##args)
#define LOG_D(fmt, args...) __android_log_print(ANDROID_LOG_DEBUG, TAG, fmt, ##args)
#define LOG_E(fmt, args...) __android_log_print(ANDROID_LOG_ERROR, TAG, fmt, ##args)


jobject open(JNIEnv *env, jobject obj, jstring path, jint baud_rate, jint flags);

jobject getFileDescriptor(JNIEnv *env, jobject obj);

jint close(JNIEnv *env, jobject obj);